#include<iostream>
using namespace std;

class Integer {
public:
   Integer(int v=0) {
      setValue(v); //>>>dangerous?
   }

   void setValue(int v) { value=v; }
   int getValue() const { return value; }
   Integer& add(const Integer &that) const {
      Integer* res=new Integer(this->value+that.value);
      return *res;
   }
   Integer& operator+(const Integer &that) const {
      return this->add(that);
   }
   bool operator==(const Integer &that) const {
      return this->value==that.value;
   }
   bool operator<(const Integer &that) const {
      return this->value<that.value;
   }
   bool operator>(const Integer &that) const {
      return this->value>that.value;
   }
   /*
   void operator*() const {
      cout<<"hi"<<endl;
   }
   */
private:
   int value;
};
ostream& operator<<(ostream& out, Integer& value) {
   return out<<value.getValue();
}

int main() {
   Integer i=10;
   Integer j(20);
   cout<<i<<endl;
   cout<<j<<endl;
   cout<<i.add(j)<<endl;
   cout<<(i+j)<<endl;
   cout<<(i==j)<<endl;
   cout<<(i<j)<<endl;
   cout<<(i>j)<<endl;
   /*
   Integer *pi=&i;
   **pi;
   */
   return 0;
}
